package com.jm.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 单品对象
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("toy")
public class Toy implements Serializable {

    private static final long serialVersionUID = 1L;
    @TableId
    private Long id;
    //名称
    private String name;
    //归属哪一个分类的  分类名称id
    private Long categoryId;
    //价格
    private BigDecimal price;
    //0 停售 1 起售
    private Integer status;
    //描述信息
    private String description;
    //图片(路径
    private String image;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableField(fill = FieldFill.INSERT)
    private Long createUser;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;

    public Toy(Long id, Integer status) {
        this.id = id;
        this.status = status;
    }
}
